<?php

namespace app\speedDating;

use app\speedDating\exception\SimpleValidateException;
use think\exception\ValidateException;

class AppController
{
    protected function validate($data, $validate, $message = [])
    {
        try {
            validate($validate, $message)->scene(request()->action())->check($data);
        } catch (ValidateException $e) {
            throw new SimpleValidateException($e->getError());
        }
        return true;
    }
}